﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LeMigue.TeamPortal.Base.Biz.Interface;
using LeMigue.Scrum.Iterface.Model;
using System.Collections.ObjectModel;

namespace LeMigue.TeamPortal.Dev.Biz
{
    public class DevSprintBiz : ISprintBiz
    {
        private IList<Sprint> _sprints = new List<Sprint>();

        public DevSprintBiz()
        {
            Sprint sprint1 = new Sprint(1, "Sprint 1")
            {
                Start = new DateTime(2012, 10, 01),
                End = new DateTime(2012, 12, 01),
            };
            sprint1.SetTasks(new System.Lazy<IList<Task>>(() => new DevTaskBiz().Tasks));
            sprint1.SetBacklogs(new System.Lazy<IList<ItemBacklog>>(() => new DevBacklogBiz().Backlogs));
            sprint1.SetBugs(new System.Lazy<IList<Bug>>(() => new DevBugBiz().Bugs));

            _sprints.Add(sprint1);
        }

        public IList<Sprint> Sprints
        {
            get
            {
                return new ReadOnlyCollection<Sprint>(_sprints);
            }
        }
    }
}
